package com.ctit.jbpm.bo;

import java.util.List;

import org.jbpm.graph.def.ProcessDefinition;
import com.ctit.jbpm.vo.*;

public interface ProcessBo {
	
	/**
	 * 部署工作流
	 * @param xml
	 * @param schema
	 * @throws Exception
	 */
	public void deployProcessDefinition(String xml, String schema) throws Exception;
	
	/**
	 * 删除工作流
	 * @param procId
	 * @throws Exception
	 */
	public void deleteProcessDefinitionById(long procId) throws Exception;

	/**
	 * 通过ID查询工作流
	 * @param procId
	 * @return
	 * @throws Exception
	 */
	public ProcessDefinition findProcessDefinitionById(long procId) throws Exception;
	
	/**
	 * 通过工作流名字查询工作流
	 * @param procId
	 * @return
	 * @throws Exception
	 */
	public ProcessDefinition findProcessDefinitionByName(String procName) throws Exception;
	
	/**
	 * 通过工作流名字查询工作流
	 * @param procId
	 * @return
	 * @throws Exception
	 */
	public List<ProcessDefinition> findProcessDefinitionByNames(List<String> procNames) throws Exception;

	
	 /**
   * 根据ID查询工作流的xml和schema信息
   */
  public ProcessDefinitionInfo findProcessDefinitionInfoByProcId(
      long procDefId) throws Exception;

	
	/**
	 * 查询出所有的工作流
	 * @return
	 * @throws Exception
	 */
	public List<ProcessDefinition> findAllProcessDefinition() throws Exception;
	
	/**
	 * 查询出指定的工作流的所有版本
	 * @param procName
	 * @return
	 * @throws Exception
	 */
	public List<ProcessDefinition> findProcessAllVersions(String procName) throws Exception;
	
	/**
	 * 模糊查询
	 * @param name
	 * @return
	 * @throws Exception
	 */
	public List<ProcessDefinition> findProcessDefinitionByPartOfName(String name) throws Exception;
	
	/**
	 * 模糊查询
	 * @param name
	 * @return
	 * @throws Exception
	 */
	public List<ProcessDefinition> findDepartmentProcessDefinitionByPartOfName(List<String> procNames, String name) throws Exception;
}
